<?php
class RegistrationView extends View
{
	public function BuildRegForm()
	{
		$this->Markup( '<form action="#" method="POST">' . "\r\n" );
		$this->Markup( '  <fieldset>' . "\r\n" );
		$this->Markup( '    <label for="username">Username:</label>' . "\r\n" );
		$this->Markup( '    <input type="text" name="username" id="username" />' . "\r\n" );
			
		$this->Markup( '    <label for="email">Email:</label>' . "\r\n" );
		$this->Markup( '    <input type="text" name="email" id="email" />' . "\r\n" );
			
		$this->Markup( '    <label for="password">Password:</label>' . "\r\n" );
		$this->Markup( '    <input type="password" name="password" id="password" />' . "\r\n" );
			
		$this->Markup( '    <label for="password_repeat">Password repeat:</label>' . "\r\n" );
		$this->Markup( '    <input type="password" name="password_repeat" id="password_repeat" />' . "\r\n" );
			
		$this->Markup( '    <input type="submit" name="submit" id="submit" value="Sign Up" />' . "\r\n" );
		
		$this->Markup( '  </fieldset>' . "\r\n" );
		$this->Markup( '</form>' . "\r\n" );
	}

	public function GetUsername()
	{
		return isset( $_POST['username'] ) ? $_POST['username'] : NULL;
	}
	
	public function GetPassword()
	{
		return isset( $_POST['password'] ) ? $_POST['password'] : NULL;
	}
	
	public function GetPasswordRepeat()
	{
		return isset( $_POST['password_repeat'] ) ? $_POST['password_repeat'] : NULL;
	}
	
	public function GetEmail()
	{
		return isset( $_POST['email'] ) ? $_POST['email'] : NULL;
	}

    public function TriedToRegister()
    {
        return isset( $_POST['submit'] );
    }
}
